/**********************************************************************************
 * Copyright (c) 2012 - 2012,  parallel, All right reserved
 * Title: com.adc.parallel.constants  ReceiveList.java 
 * @author shen  shenqiao2012@163.com 
 *  2012-11-21 下午4:11:54 
 *********************************************************************************/


package com.adc.parallel.constants;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;


@SuppressWarnings({"unchecked","rawtypes"})
public class ReceiveList {
	/**
	 *  task dto receive list
	 */
	private static List receiveList;
	
	/**
	 * @return the receiveList
	 */
	public synchronized static List getReceiveList() {
		if (receiveList==null) {
			receiveList=Collections.synchronizedList(new ArrayList());
		}
		return receiveList;
	}
	
	/**
	 * 
	 * Description: define list type
	 * author:  shen
	 * @return String
	 */
	public static String getType() {
		return SysConstants.ListType_RE;
	}
	
	/**
	 * 
	 * Description: to clear processed dto
	 * author:  shen
	 * @param list 
	 * @return void
	 */
	public static void removeAllDto(final List list) {
		receiveList.removeAll(list);
	}
	
	/**
	 * 
	 * Description: add taskDto to receive List
	 * author:  shen
	 * @param taskDto 
	 * @return void
	 */
	public synchronized static void addTaskDto(Object taskDto) {
		receiveList.add(taskDto);
	}

}
